package com.ag.lzw.dao;

import java.util.List;

import com.ag.bean.TbUser;
import com.ag.dao.TbUserDAO;

public class LzwTbUserDAO extends TbUserDAO {
	
	public List findDeptByUid(String id) {
        String hql = " ";
		return getHibernateTemplate().find(hql);
	}
	
	public TbUser findUserById(String uid){
        String hql = "From TbUser tt left join fetch tt.tbUserDepts where tt.UId='"+uid+"'";
		List<TbUser> list = getHibernateTemplate().find(hql);
		TbUser user = null;
		for(TbUser tt : list){
			if(tt!=null){
				user = tt;
			}
		}
		return user;
	}
}
